package com.xqt.base.entity;

import com.xqt.base.page.BasePage;
import com.xqt.enums.Deleted;

import java.util.Date;


public class BaseEntity extends BasePage {

    /**  */
    private static final long serialVersionUID = -8688517304895132357L;

    // 主键
    private String id;
    // 关系归属
    private String relation;
    // 创建人
    private String createBy;
    // 创建日期
    private Date createDate;
    // 更新人
    private String updateBy;
    // 更新时间
    private Date updateDate;
    // 备注
    private String remarks;
    // 删除标志（0：正常，1：已删除）
    private Integer delFlag;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getRelation() {
        return relation;
    }

    public void setRelation(String relation) {
        this.relation = relation;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public Integer getNomalDelFlag() {
        return Deleted.DELETED_NO.getKey();
    }

    public Integer getDeletedFlag() {
        return Deleted.DELETED_YES.getKey();
    }

//    public void preInsert() {
//        this.setId(UUID.randomUUID().toString());
//        this.setCreateDate(DateUtils.getDate());
//        this.setUpdateDate(DateUtils.getDate());
//        Operator operator = SessionLocalUtils.getOperator();
//        if (operator != null && operator.getMember() != null) {
//            this.setCreateBy(operator.getMember().getId());
//            this.setUpdateBy(operator.getMember().getId());
//        }
//        this.setDelFlag(DELETED.NO.key);
//    }
//
//    public void preUpdate() {
//        this.setUpdateDate(DateUtils.getDate());
//        Operator operator = SessionLocalUtils.getOperator();
//        if (operator != null && operator.getMember() != null) {
//            this.setUpdateBy(operator.getMember().getId());
//        }
//    }
}
